package com.csxy.hql.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Schema(name = "EduVideo对象",description = "课程视频")
@TableName("edu_video") // 指定对应的数据库表名
public class EduVideo implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "视频ID")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @Schema(description = "课程ID")
    private String courseId; // 对应 course_id 字段

    @Schema(description = "章节ID")
    private String chapterId; // 对应 chapter_id 字段

    @Schema(description = "节点名称")
    private String title;

    @Schema(description = "云端视频资源")
    private String videoSourceId;

    @Schema(description = "原始文件名称")
    private String videoOriginalName;

    @Schema(description = "排序字段")
    private Integer sort;

    @Schema(description = "播放次数")
    private Long playCount;

    @Schema(description = "是否可以访问：0收费 1免费")
    private Integer isFree;

    @Schema(description = "视频时长(秒)")
    private Float duration;

    @Schema(description = "状态: Empty卡上传, Transcoding转码中, Normal正常")
    private String status;

    @Schema(description = "视频源文件大小(字节)")
    private Long size;

    @Schema(description = "乐观锁")
    @Version // 乐观锁注解
    private Long version;

    @Schema(description = "创建时间", example = "2020-01-01 00:00:00")
    @TableField(fill = FieldFill.INSERT)
    private Date gmtCreate;

    @Schema(description = "更新时间", example = "2020-01-01 00:00:00")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date gmtModified;
}